const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  // 配置路径别名
  // chainWebpack: config => {
  //   config.resolve.alias
  //     .set("@", resolve("/pages"))
  //     .set("components", resolve("/components"))
  //     .set("images", resolve("/static/images"));
  // },
  // 路径别名
  configureWebpack: {
    resolve: {
      alias: {
        images: resolve("/static/images"),
        components: resolve("/components")
      }
    }
  },
  chainWebpack: config => {
    config.module
      .rule("mjs$")
      .test(/.mjs$/)
      .include.add(/node_modules/)
      .end()
      .type("javascript/auto");
  }
  // devServer: {
  //   port: "8083",
  //   disableHostCheck: true,
  //   proxy: {
  //     "/minio": {
  //       target: "http://172.245.94.40:8080",
  //       changeOrigin: true,
  //       pathRewrite: {
  //         "^/minio": ""
  //       }
  //     }
  //   }
  // }
};
